Skip to content

libstore-tests: Add reference scanning benchmark#13682

Merged
Ericson2314 merged 1 commit intoNixOS:masterfrom
xokdvium:refscan-benchmark
Aug 4, 2025
Merged

libstore-tests: Add reference scanning benchmark#13682
Ericson2314 merged 1 commit intoNixOS:masterfrom
xokdvium:refscan-benchmark

Conversation

@xokdvium
Copy link
Contributor

@xokdvium xokdvium commented Aug 3, 2025

Motivation

This benchmark should provide a relatively realistic scenario for reference scanning.

As shown by the following results, reference scanning code is already plenty fast and is definitely not a bottleneck:

BM_RefScanSinkRandom/10000               1672 ns         1682 ns       413354 bytes_per_second=5.53691Gi/s
BM_RefScanSinkRandom/100000             11217 ns        11124 ns        64341 bytes_per_second=8.37231Gi/s
BM_RefScanSinkRandom/1000000           205745 ns       204421 ns         3360 bytes_per_second=4.55591Gi/s
BM_RefScanSinkRandom/5000000          1208407 ns      1201046 ns          597 bytes_per_second=3.87713Gi/s
BM_RefScanSinkRandom/10000000         2534397 ns      2523344 ns          273 bytes_per_second=3.69083Gi/s

(Measurements on Ryzen 5900X via nix build --file ci/gha/tests componentTests.nix-store-tests-run -L)

Context


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

@xokdvium xokdvium requested a review from Mic92 August 3, 2025 22:24
@xokdvium xokdvium requested a review from edolstra as a code owner August 3, 2025 22:24
@xokdvium
Copy link
Contributor Author

xokdvium commented Aug 3, 2025

cc @avnik, wrt to changes from #13680. This could be useful to run and double-check that codegen of the reference scanning code does not regress.

@xokdvium xokdvium force-pushed the refscan-benchmark branch from a69e828 to 585d914 Compare August 3, 2025 23:06
This benchmark should provide a relatively realistic
scenario for reference scanning.

As shown by the following results, reference scanning code
is already plenty fast and is definitely not a bottleneck:

```
BM_RefScanSinkRandom/10000               1672 ns         1682 ns       413354 bytes_per_second=5.53691Gi/s
BM_RefScanSinkRandom/100000             11217 ns        11124 ns        64341 bytes_per_second=8.37231Gi/s
BM_RefScanSinkRandom/1000000           205745 ns       204421 ns         3360 bytes_per_second=4.55591Gi/s
BM_RefScanSinkRandom/5000000          1208407 ns      1201046 ns          597 bytes_per_second=3.87713Gi/s
BM_RefScanSinkRandom/10000000         2534397 ns      2523344 ns          273 bytes_per_second=3.69083Gi/s
```

(Measurements on Ryzen 5900X via `nix build --file ci/gha/tests componentTests.nix-store-tests-run -L`)
@xokdvium xokdvium force-pushed the refscan-benchmark branch from 585d914 to 20df0e5 Compare August 3, 2025 23:11
@Ericson2314 Ericson2314 merged commit 7abfc9b into NixOS:master Aug 4, 2025
14 checks passed
@xokdvium xokdvium deleted the refscan-benchmark branch October 12, 2025 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants